

#ifndef _H_ACTORFACTORY
#define _H_ACTORFACTORY

#pragma comment( lib, "Actor.lib" )
#pragma comment( lib, "ActorComponentCreator.lib" )
#pragma comment( lib, "ActorComponent.lib" )
#pragma comment( lib, "TinyXML2.lib" )


#include "Actor.h"
#include "ActorComponent.h"
#include "ActorComponentCreator.h"
#include "TinyXML2.h"

#include <memory>
#include <map>
#include <string>

namespace TraceEngine
{
	// Typedefs
	typedef unsigned long ActorID;
	typedef std::shared_ptr<Actor> StrongActorPtr;
	typedef std::shared_ptr <ActorComponent> StrongActorComponentPtr;
	typedef std::map<std::string, ActorComponentCreator> ActorComponentCreatorMap;
	//typedef ActorComponent *(*ActorComponentCreator)(void);

	class ActorFactory
	{
		public:
			ActorID m_LastActorID;

			// Constructors
			ActorFactory( void );

			StrongActorPtr createActor( const char* actorResource );

		protected:
			ActorComponentCreatorMap m_ActorComponentCreators;

			virtual StrongActorComponentPtr createComponent( tinyxml2::XMLElement* pData );

		private:
			ActorID getNextActorID( void ) { ++this->m_LastActorID; return this->m_LastActorID; }

	};

}

#endif // !_H_ACTORFACTORY
